<template>
    <iframe :src="url" style="width: 100%;height: 100%; border: none;"></iframe>
</template>

<script>
import TokenUtil from "@/common/TokenUtil";

export default {
    name: "UreportView",
    props: {
        config: {
            type: Object,
            default: {}
        },
    },
    data() {
        return {
            ureport: '',
            url: ''
        }
    },
    created() {
        this.ureport = JSON.parse(this.config.ureport).text;
        let wPath = window.document.location.origin;
        let token = TokenUtil.getToken();
        let mobileAppId = uni.getStorageSync("mobileAppId");
        this.url = wPath + '/ureport/preview?_u=qiaolin-' + this.ureport + '&accessToken=' + token + '&appId=' + mobileAppId;

    }
}
</script>

<style scoped>

</style>
